a = [3, 4, 1, 5, 2]

for j in range(len(a)):
    for i in range(len(a)-j):
        if i != 0:
            if a[i] < a[i-1]:
                a[i-1], a[i] = a[i], a[i-1]
    print(a)

print(a)
    
